package com.lindroy.androidplayer.viewmodels

import androidx.lifecycle.ViewModel
import java.text.SimpleDateFormat
import java.util.*

/**
 * @author Lin
 * @date 2022/2/14
 * @function
 */
data class CoinHistoryViewModel(
    val coinCount: Int = 0,
    val date: Long = 0,
    val desc: String = "",
    val id: Int = 0,
    val reason: String = "",
    val type: Int = 0,
    val userId: Int = 0,
    val userName: String = ""
) : ViewModel() {
    val coinDetail: String
        get() = "$reason：${desc.substringAfterLast("：").trim()}"

    val formatDate: String
        get() = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.CHINA).format(Date(date))
}
